import React, { Component } from 'react'
import { Form, Input } from 'antd'
import PropTypes from 'prop-types'
// 添加分类的form组件
export default class AddForm extends Component {

  static propTypes = {
    setName: PropTypes.func
  }
  changeName = (event) => {
    this.props.setName(event.target.value)
  }

  render() {
    return (
      <Form>
        <Form.Item 
          label="角色名称"
          name="roleName"
          rules={[{required: true, message: '角色名称必须输入'}]}
        >
          <Input 
            onChange={this.changeName} 
            placeholder="请输入角色" 
          />
        </Form.Item>
      </Form>
    )
  }
}
